//
//  ZDOAuthViewController.swift
//  1026SwiftSinaWeiBo
//
//  Created by Apple on 15/10/28.
//  Copyright © 2015年 itcast. All rights reserved.
//

import UIKit

class ZDOAuthViewController: UIViewController {
    
    
    override func loadView() {
        
        view = webView
    }
    

    override func viewDidLoad() {
        super.viewDidLoad()

        title = "新浪微博"
        
        navigationItem.rightBarButtonItem = UIBarButtonItem(title: "取消", style: UIBarButtonItemStyle.Done, target: self, action: "cancel")
        
        automaticallyAdjustsScrollViewInsets = false
        
        //加载新浪登录接口
        let url = ZDNetworkTool.sharedInstance.authURL()
        //加载请求
        webView.loadRequest(NSURLRequest(URL: url))
        
    }

    
    //MARK: - 取消登录
    func cancel() {
    
        dismissViewControllerAnimated(true, completion: nil)
    }
    
    
    //MARK: - 懒加载
    lazy var webView: UIWebView = UIWebView()

}


extension ZDOAuthViewController: UIWebViewDelegate {

    
}
